home *** CD-ROM | disk | FTP | other *** search
Wrap
-- card: 5502 from stack: in -- bmap block id: 6476 -- flags: 4000 -- background id: 2723 -- name: recover card ----- HyperTalk script ----- on openStack set scroll of card field "Help" to 0 pass openStack end openStack on openCard set userLevel to 5 if number of cards ≠ 1 then show button "Prev" show button "Next" else hide button "Prev" hide button "Next" end if hide msg end openCard -- get file name given path name function fileFromPath path get empty if path is not empty then put length(path) into m repeat with i = m down to 1 if char i of path is ":" then exit repeat put char i of path before it end repeat end if return it end fileFromPath -- remove file name from path name function pathName path get path if it is not empty then put length(it) into m repeat with i = m down to 1 if char i of it is ":" then exit repeat delete char i of it end repeat end if return it end pathName -- part 1 (field) -- low flags: 01 -- high flags: 2004 -- rect: left=25 top=85 right=109 bottom=491 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: stack path ----- HyperTalk script ----- on mouseUp put fileName("STAK") into me end mouseUp -- part 2 (field) -- low flags: 00 -- high flags: 2007 -- rect: left=339 top=152 right=329 bottom=489 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: bad cards -- part 3 (field) -- low flags: 01 -- high flags: 2002 -- rect: left=25 top=152 right=174 bottom=132 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: current card -- part 4 (button) -- low flags: 00 -- high flags: A004 -- rect: left=25 top=217 right=243 bottom=100 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Recover ----- HyperTalk script ----- on mouseUp global path, stackName put card field "stack path" into path put fileFromPath(path) into stackName if path is empty or stackName is empty then answer "Specify stack to recover first." with "OK" exit mouseUp end if recover end mouseUp -- fixed problem with substring hits 11/17/89 mj on recover global path, stackName global myName, theCard put the short name of this stack into myName put the short id of this card into theCard set lockMessages to true put true into getStackScript put return & card field "bad cards" & return into broken put (card field "current card") + 1 into j put 0 into n put "Recovering “" & stackName & "”" repeat with i = j to 16777216 -- max cards/stack if (return & i & return) is not in broken then put i into card field "current card" lock screen go to card i of stack stackName if the result is empty then if getStackScript then put script of this stack into theScript end if doMenu "Copy Card" go to last card of stack myName doMenu "Paste Card" add 1 to n go card id theCard of stack myName if getStackScript then set script of this stack to theScript put false into getStackScript end if else go card id theCard of stack myName put empty into card field "current card" exit repeat end if unlock screen end if end repeat put "Compacting…" doMenu "Compact Stack" openCard put n && "cards recovered." set cursor to arrow end recover -- part 5 (button) -- low flags: 00 -- high flags: A004 -- rect: left=170 top=152 right=175 bottom=287 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: >> Copy >> ----- HyperTalk script ----- on mouseUp get card field "current card" if it is not empty then if (it & return) is not in card field "bad cards" then put it & return after card field "bad cards" end if end if end mouseUp -- part 6 (button) -- low flags: 00 -- high flags: A004 -- rect: left=25 top=185 right=211 bottom=100 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Clear ----- HyperTalk script ----- on mouseUp answer "Really clear everything?" with "Yes" or "No" if it is "Yes" then put empty into card field "bad cards" put empty into card field "current card" set cursor to busy set lockMessages to true lock screen put the id of this card into saveMe put number of cards into m repeat with i = m down to 1 go to card i if (the id of this card) ≠ saveMe then set cantDelete of this card to false doMenu "Delete Card" end if end repeat set script of this stack to empty put "Compacting…" doMenu "Compact Stack" put empty openCard set cursor to arrow end if end mouseUp -- part 7 (button) -- low flags: 00 -- high flags: 2000 -- rect: left=3 top=309 right=339 bottom=42 -- title width / last selected line: 0 -- icon id / first selected line: 21700 / 21700 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Home ----- HyperTalk script ----- on mouseUp go Home end mouseUp -- part 8 (button) -- low flags: 80 -- high flags: 2000 -- rect: left=179 top=315 right=339 bottom=210 -- title width / last selected line: 0 -- icon id / first selected line: 1014 / 1014 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Prev ----- HyperTalk script ----- on mouseUp go prev card end mouseUp -- part 9 (button) -- low flags: 80 -- high flags: 2000 -- rect: left=213 top=315 right=339 bottom=244 -- title width / last selected line: 0 -- icon id / first selected line: 1013 / 1013 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Next ----- HyperTalk script ----- on mouseUp go next card end mouseUp -- part 10 (button) -- low flags: 00 -- high flags: 2000 -- rect: left=463 top=10 right=39 bottom=503 -- title width / last selected line: 0 -- icon id / first selected line: 19678 / 19678 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Info ----- HyperTalk script ----- on mouseDown show card field "Info" repeat while the mouse is down end repeat hide card field "Info" end mouseDown -- part 11 (field) -- low flags: 81 -- high flags: 2004 -- rect: left=344 top=2 right=90 bottom=510 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 2 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Info ----- HyperTalk script ----- on mouseUp hide me end mouseUp -- part 12 (field) -- low flags: 01 -- high flags: 0007 -- rect: left=116 top=185 right=303 bottom=330 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: Help -- part contents for card part 11 ----- text ----- by Greg Jorgensen Macintosh Developer Technical Support © 1989 Apple Computer, Inc. -- part contents for card part 12 ----- text ----- How to use Recover Stack ---------------------------- Recover Stack attempts to recover broken Hypercard stacks by copying all of the good cards out of the corrupted stack, ignoring the broken ones. Everything needed to run Recover Stack is on this card, except for the FileName XFCN, which is in the stack. Recover Stack puts all of the good cards from the corrupted stack after itself in this stack. To use, make a copy of this stack, rename it, and start it up. Select the corrupted stack to recover by clicking on the field under “Name of stack to recover” above. If you know the numbers (not IDs) of the bad cards in the corrupted stack, type them in, one per line, in the field “Bad card numbers” to the right. Click on “Recover” to begin. If a bad card that is not in the bad card list is encountered, Hypercard will abort. Just restart this stack, use the “Copy” button above to add the broken card to the list, and click on “Recover” to proceed. You can clear everything by clicking on “Clear.” It will clear the bad card list and delete any recovered cards in this stack, leaving only this card. When all good cards have been recovered, you can delete this card from the stack (You’ll have to change its “CantDelete” property first — pull down “Card Info” from the “Objects” menu). You will then have a stack containing all of the recovered cards. Backgrounds are preserved, and the stack script from the corrupted stack will be in this stack’s script. Recover Stack won’t be able to recover all corrupted stacks — it is possible for a stack to be corrupted in such a way that it can’t be opened at all. Recover Stack will be able to recover from the most common kinds of corruption, with a minimum loss of cards.